//1.导入vue、路由模块和登录组件
//vue
import Vue from "vue";
//vue-router../views/Login.vue
import VueRouter from "vue-router"
//路由组件
// 主路由
import Main from "../App.vue"
//登录路由组件
import Login from "../views/MyLogin.vue"
// 人脸登录路由
import Face from "../views/MyFace.vue"
//进入学校(校内学院选择)组件
import School from "../components/Content/ContentComponent.vue"
// 进入学院路由组件

import Department from '../views/MyDepartment.vue'
//进入班级对比路由组件

import Level from '../views/MyLevel.vue'
//进入个人对比路由组件
import People from "../views/MyPeople.vue";
// 进入个人页面（个人详细信息）组件
import Person from "../components/Personal/PersonalComponents.vue"
Vue.use(VueRouter)
//2.将路由和组件进行映射
const routes = [{
    path: '/',
    name: 'Login',
    //  主路由
    component: Main,
    redirect: '/login',//当页面地址为"/"时重定向到'/login'
    // hidden: true,
    children: [
        {
            path: 'face',
            name: 'face',
            component: Face,
        },
        {
            path: 'school',
            name: 'school',
            component: School,
        },
        {
            path: 'department',
            name: 'department',
            component: Department,
            //进入学院
            children: [{
                path: 'level',
                name: 'level',
                component: Level,//班级间对比组件


            }, {
                path: 'people',
                name: 'people',
                component: People//个人之间对比
            }]
        },

        {
            path: 'person',
            name: 'person',
            component: Person,
        },
    ]
},
{
    path: '/login',
    name: 'login',
    component: Login
}]

//3.创建router实例

const router = new VueRouter({
    routes//(缩写)相当于routes：routes
})

// 4.将当前的router实例向外进行暴露
export default router